// 用户相关类型定义

// 基础响应类型
export interface ApiResponse<T = unknown> {
  code: number
  message: string
  data: T
}

// 分页响应类型
export interface PageResponse<T> {
  records: T[]
  total: number
  size: number
  current: number
  pages: number
}

// 用户基础信息
export interface User {
  id: string
  userAccount: string
  userPassword?: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  userRole: 'user' | 'admin'
  userPhone?: string
  userEmail?: string
  birthday?: string
  editTime?: string
  createTime?: string
  updateTime?: string
  isDelete?: number
}

// 用户VO（视图对象）
export interface UserVO {
  id: string
  userAccount: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  userRole: 'user' | 'admin'
  userEmail?: string
  userPhone?: string
  birthday?: string
  createTime?: string
}

// 登录用户信息
export interface LoginUserVO {
  id: string
  userAccount: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  userRole: 'user' | 'admin'
  userEmail?: string
  userPhone?: string
  birthday?: string
  createTime?: string
  updateTime?: string
}

// 用户登录请求
export interface UserLoginRequest {
  userAccount: string
  userPassword: string
}

// 用户注册请求
export interface UserRegisterRequest {
  userAccount: string
  userPassword: string
  checkPassword: string
}

// 用户编辑请求
export interface UserEditRequest {
  id?: string
  userAccount?: string
  userPhone?: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  birthday?: string
  userEmail?: string
}

// 用户添加请求
export interface UserAddRequest {
  userName?: string
  userAccount: string
  userAvatar?: string
  userProfile?: string
  userRole: 'user' | 'admin'
  userEmail?: string
  userPhone?: string
  birthday?: string
}

// 用户更新请求
export interface UserUpdateRequest {
  id: string
  userName?: string
  userAvatar?: string
  userProfile?: string
  userRole?: 'user' | 'admin'
  userEmail?: string
  userPhone?: string
  birthday?: string
}

// 用户查询请求
export interface UserQueryRequest {
  current?: number
  pageSize?: number
  sortField?: string
  sortOrder?: string
  id?: string
  userName?: string
  userAccount?: string
  userProfile?: string
  userRole?: 'user' | 'admin'
}

// 删除请求
export interface DeleteRequest {
  id: string
}
